import { Injectable } from '@angular/core';

Injectable()
export class StorageService {
    static ins: any = (<any>window);
    constructor() {
    }

    static setSesstionStorage(pair: any): void {
        this.ins.sessionStorage[pair.key] = pair.value;
    }

    static getSessionStorageByKey(key: string): any {
        return this.ins.sessionStorage[key];
    }

    static setLocalStorage(pair: any): void {
        this.ins.localStorage[pair.key] = pair.value;
    }

    static getLocalStorageByKey(key: string): any {
        return this.ins.localStorage[key];
    }
}